package cn.iocoder.yudao.module.erp.dal.mysql.outinrule;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.erp.dal.dataobject.outinrule.OutInRuleDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.erp.controller.admin.outinrule.vo.*;

/**
 * ERP 出入库规则 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface OutInRuleMapper extends BaseMapperX<OutInRuleDO> {

    default PageResult<OutInRuleDO> selectPage(OutInRulePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<OutInRuleDO>()
                .eqIfPresent(OutInRuleDO::getRuleType, reqVO.getRuleType())
                .eqIfPresent(OutInRuleDO::getRule, reqVO.getRule())
                .orderByDesc(OutInRuleDO::getId));
    }

}